<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!--/*@thymesVar id="foreignCurrencyTypes" type="java.util.List<com.weirong.smartvault.backservice.entity_model.ForeignCurrencyTypeModel>"*/-->
<div class="well well-lg" style="margin-bottom: 0px;">
    <div align="right" style="margin-bottom:10px">
        <button class="btn btn-primary" data-toggle="modal" data-target=".parent-type">新增</button>
    </div>
    <table class="table table-bordered" style="margin-bottom: 0px;">
        <tr class="info" width="100%">
            <th width="7%">序号</th>
            <th width="9%">币种名称</th>
            <th width="9%">币种编码</th>
            <th width="9%">币种单位</th>
            <th>描述</th>
            <th width="17%">操作</th>
        </tr>

        <tr th:each="type,iterstat:${foreignCurrencyTypes}">
            <td th:text="${iterstat.index}">1</td>
            <td th:text="${type.getName()}">美元</td>
            <td th:text="${type.getCode()}">USD</td>
            <td th:text="${type.getUnit()}">美元</td>
            <td th:text="${type.getDescription()}"></td>
            <td><a href="#" data-toggle="modal" th:attr="data-target=${'.child-type'+type.getId()}">修改</a>
                &nbsp;&nbsp;<a th:href="@{/API/foreignCurrencyTypeDelete(id=${type.getId()})}">删除</a>
                &nbsp;&nbsp;<a href="#" data-toggle="modal"
                               th:attr="data-target=${'.denomination'+type.getId()}">查看面额</a></td>
        </tr>
    </table>
</div>
<div class="modal fade parent-type" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">新增币种</h4>
            </div>
            <form method="post">
                <div class="modal-body">
                    <table style="width: 800px;">
                        <tr width="100%">
                            <td width="10%">&nbsp;</td>
                            <td width="20%">币种名称</td>
                            <td><input name="name" type="text" placeholder="请输入币种名称" class="form-control"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>币种编码</td>
                            <td><input name="code" type="text" placeholder="请输入币种编码" class="form-control"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>币种单位</td>
                            <td><input name="unit" type="text" placeholder="请输入币种单位" class="form-control"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>述</td>
                            <td><textarea name="description" class="form-control" rows="3"></textarea></td>
                        </tr>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <input type="submit" class="btn btn-primary" value="Save changes"/>
                </div>
            </form>

        </div>
    </div>
</div>
<div th:each="type,iterstat:${foreignCurrencyTypes}" th:class="|modal fade child-type${type.getId()}|" tabindex="-1"
     role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <form method="post">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">币种修改</h4>
                </div>
                <input type="hidden" value="上级项目的ID"/>
                <input type="hidden" th:value="${type.getId()}" name="id"/>
                <div class="modal-body">
                    <table style="width: 800px;">
                        <tr width="100%">
                            <td width="10%">&nbsp;</td>
                            <td width="20%">币种名称</td>
                            <td><input name="name" type="text" placeholder="请输入币种名称" class="form-control"
                                       th:value="${type.getName()}"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>币种编码</td>
                            <td><input type="text" name="code" placeholder="请输入币种编码" class="form-control"
                                       th:value="${type.getCode()}"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>币种单位</td>
                            <td><input name="unit" type="text" placeholder="请输入币种单位" class="form-control"
                                       th:value="${type.getUnit()}"/></td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>项目描述</td>
                            <td><textarea th:text="${type.getDescription()}" name="description" class="form-control"
                                          rows="3">测试</textarea></td>
                        </tr>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <input type="submit" class="btn btn-primary" value="Save changes"/>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:each="type,iterstat:${foreignCurrencyTypes}" th:class="|modal fade denomination${type.getId()}|" tabindex="-1" role="dialog"
     aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">美元常用面额查看</h4>
            </div>
            <input type="hidden" value="上级项目的ID"/>
            <div class="modal-body">
                <table class="table table-bordered" style="margin-bottom: 0px;">
                    <tr class="info" width="100%">
                        <th width="7%">序号</th>
                        <th width="15%">面额名称</th>
                        <th width="15%">面额数值</th>
                        <th>描述</th>
                    </tr>
                    <tr th:each="denomination,iterstat:${type.getForeignCurrencyDenomination()}">
                        <td th:text="${iterstat.index+1}">1</td>
                        <td th:text="${denomination.getName()}">5</td>
                        <td th:text="${denomination.getValue()}">5</td>
                        <td th:text="${denomination.getDescription()}"></td>
                    </tr>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
</html>
